package com.caigou.comm.base.ext

import android.content.Context
import cc.shinichi.library.ImagePreview
import com.caigou.comm.R

/**
 * @author #Suyghur.
 * Created on 2021/11/29
 */

fun showImgsPreview(context: Context, urls: MutableList<String>, pos: Int) {
    ImagePreview.getInstance().setContext(context)
        .setIndex(pos)
        .setImageList(urls)
        .setZoomTransitionDuration(300)
        .setShowErrorToast(true)
        .setShowCloseButton(true)
        .setShowDownButton(true)
        .setErrorPlaceHolder(R.drawable.load_failed)
        .start()
}

fun showImgPreview(context: Context, url: String) {
    ImagePreview.getInstance().setContext(context)
        .setImage(url)
        .setZoomTransitionDuration(300)
        .setShowErrorToast(true)
        .setShowCloseButton(true)
        .setShowDownButton(true)
        .setErrorPlaceHolder(R.drawable.load_failed)
        .start()
}